<ion-view >

<header  class="bar bar-header  user-defined-header user-header-style1 " >
		<!--<button class="button button-clear icon ion-ios-search" ng-click="show_search()"></button>-->
			<h1 class="title ">茶舍</h1>
		<button class="button icon ion-ios-compose-outline font-size-md"  ng-class="{'ion-ios-compose-outline':teaTalk_bt,'ion-ios-location-outline tea-shop-place':teaShop_bt}" ng-click="chooseEvent()">{{gps_place}}</button>
</header>

<header  class="bar bar-subheader  bar-stable bar-mycolor no-border" >
	<div class="row row-center bk-white row-margin">
		<div class="content-center">
			<button class="bt-style2 " ng-class="{'bt-active2':teaTalk_bt}" ng-click="goTeaTalk()">茶谈</button>
			<button class="bt-style2"  ng-class="{'bt-active2':teaShop_bt}" ng-click="goTeaShop()">茶馆</button>
		</div>
	</div>
</header>

<ion-content class="has-subheader bk-gray" data-ng-init="goTeaTalk()">
	<ion-refresher
	    pulling-text="下拉刷新..."
	    on-refresh="doRefresh()">
	</ion-refresher>

	<div ng-show="tea_talk">

		<div class="bt-group bk-white margin-top-10" >
			<span class="bt-style1" ng-class="{'bt-active1':isLast}" ng-click="loadLastTalk()">最新发布</span>
			<span class="bt-style1" ng-class="{'bt-active1':!isLast}" ng-click="loadEliteTalk()">精选推荐</span>
		</div>

		<!--ionic img标签有奇怪的改都改不掉的间隔，用这个代替吧-->
		<div class="teatalk-img-row">
			<img src="{{ad.image}}" ng-click="goToAdPage(ad.id)"/>
		</div>

		<div class="myrow bk-white" ng-repeat="item in teaTalk_list">
			<div class="teatalk-item ">
				<div class="teatalk-item-header">
					<div class="float-left">
						<div class="row-flex">
							<div class="teatalk-store-logo float-left">
								<img src="{{item.user.avatar}}" ng-click="goToUserDetailPage(item.user.id)"/>
							</div>
							<div class="float-left">
								<div>
									<span class="teatalk-store-name">{{item.user.nickname}}</span>
									<span class="teatalk-store-icon">
										<span class="" ng-show="false">vip</span>
										<span class="" ng-show="false">oh</span>
									</span>
								</div>
								<div class="teatalk-store-info">
									<span class="">{{item.created_time}}</span>
									<span class="">来自{{item.created_addr}}</span>
								</div>
							</div>
						</div>
					</div>
					<div class="teatalk-store-attent float-right" ng-click="follow_user(item.user.id, item.user.is_followed)">
						<span id="" class="float-right bt-style3">{{ item.user.is_followed == true ? '取消关注' : '+关注'}}</span>
					</div>
				</div>

				<div class="teatalk-item-body">
					<p class="teatalk-item-intrud ">{{item.content}}</p>
					<ion-gallery ion-gallery-items="item.imglist" ion-gallery-toggle="false"></ion-gallery>
					<!--<div class=" row_autoWarp auto-warp-img">
						<div class="col-33" ng-repeat="img in item.imglist" ng-click="photoBrowser($index, item.imglist)">
							<img src="{{img}}"/>
						</div>
					</div>-->
					<div class="teatalk-item-place">
						<span >
							<a class="subdued icon ion-ios-location">{{item.created_addr}}</a>
						</span>
					</div>
				</div>

				<div class="teatalk-item-share margin-top-10">
					<div class="teatalk-share-bt float-left"  ng-click="tea_talk_share(item)">
						<span>
							<a  class="subdued icon ion-share icon-num icon-20"></a>
						</span>
					</div>
					<div class="teatalk-share-bt float-left" ng-click="goto_talk_comntent(item)">
						<span>
							<a class="subdued icon ion-ios-chatbubble-outline icon-num icon-20">{{item.comment_count}}</a>
						</span>
					</div>
					
					<div class="teatalk-share-bt float-left" ng-click="talk_upvote(item)" ng-if="!item.is_upvote">
						<span>
							<a  class="subdued icon ion-ios-heart-outline icon-num icon-20">{{item.up_count}}</a>
						</span>
					</div>
					<div class="teatalk-share-bt float-left" ng-click="talk_upvote_cancel(item)" ng-if="item.is_upvote">
						<span>
							<a  class="subdued icon ion-ios-heart-outline icon-num icon-20 font-color-xg">{{item.up_count}}</a>
						</span>
					</div>
				</div>
			</div>

		</div>
	</div>

	<div ng-show="tea_shop">
		<div class="myrow bk-white" id="tea-shops">

			<div class="tea-shop-item" ng-repeat="item in shopList">
				<img class="tea-shop-img" src={{item.image}} ng-click="goto_shop(item)"/>
				<div class="tea-shop-info">
					<span class="tea-shop-name">{{item.name}}</span>
					<!--<span class="tea-shop-icons">
						<span class="tea-shop-icon">
							<img src="img/store/vip.png"/>
						</span>
						<span class="tea-shop-icon">
							<img src="img/store/shang.png"/>
						</span>
					</span>-->
					<span id="" class="float-right bt-style3" ng-click="tea_house_follow(item)">{{item.is_follow == true ? "取消关注" : "+关注"}}</span>
				</div>
			</div>

		</div>
	</div>
	
	<ion-infinite-scroll  ng-if="!isStop_scroll && isLast && tea_talk" on-infinite="scroll_load_talk()" distance="1%" ></ion-infinite-scroll>
	<ion-infinite-scroll  ng-if="!isStop_scroll && !isLast && tea_talk" on-infinite="scroll_load_edit()" distance="1%" ></ion-infinite-scroll>
	<ion-infinite-scroll  ng-if="!isStop_scroll && tea_shop" on-infinite="scroll_load_shop()" distance="1%" ></ion-infinite-scroll>

</ion-content >

</ion-view>
